﻿using System.Collections.Generic;
using System.IO;
using System.Text.Json.Serialization;

namespace movie.tool.module.film.model
{
    /// <summary>
    /// 剧本
    /// </summary>
    public class Movie
    {
        private long id;
        private string name;
        private string dir;
        private string version;
        private List<Scene> scenes;
        private List<ClueCard> clueCards;
        private DriveInfo driveInfo;
        /// <summary>
        /// 标识
        /// </summary>
        [JsonPropertyNameAttribute("id")]
        public long Id { get => id; set => id = value; }
        /// <summary>
        /// 剧本名称
        /// </summary>
        [JsonPropertyNameAttribute("name")]
        public string Name { get => name; set => name = value; }
        /// <summary>
        /// 存储目录，相对目录，便于移动
        /// </summary>
        public string Dir { get => dir; set => dir = value; }
        /// <summary>
        /// 版本
        /// </summary>
        [JsonPropertyNameAttribute("version")]
        public string Version { get => version; set => version = value; }
        /// <summary>
        /// 标签
        /// </summary>
        [JsonPropertyNameAttribute("tag")]
        public string[] Tag { get; set; }
        /// <summary>
        /// 购买状态。值为full-买断；room-当前房间；notOrdered-未订购
        /// </summary>
        [JsonPropertyNameAttribute("purchaseStatus")]
        public string PurchaseStatus { get; set; }
        /// <summary>
        /// 作者
        /// </summary>
        [JsonPropertyNameAttribute("author")]
        public string Author { get; set; }
        /// <summary>
        /// 简介
        /// </summary>
        [JsonPropertyNameAttribute("brief")]
        public string Brief { get; set; }
        /// <summary>
        /// 最少玩家数量
        /// </summary>
        [JsonPropertyNameAttribute("minPlayers")]
        public int MinPlayers { get; set; }
        /// <summary>
        /// 最多玩家数量
        /// </summary>
        [JsonPropertyNameAttribute("maxPlayers")]
        public int MaxPlayers { get; set; }
        /// <summary>
        /// 发布时间，yyyy-MM-dd HH:mm:ss格式
        /// </summary>
        [JsonPropertyNameAttribute("publishTime")]
        public string PublishTime { get; set; }
        /// <summary>
        /// 开本次数,整数
        /// </summary>
        [JsonPropertyNameAttribute("playTimes")]
        public int PlayTimes { get; set; }
        /// <summary>
        /// 大概时长,字符串
        /// </summary>
        [JsonPropertyNameAttribute("duration")]
        public string Duration { get; set; }
        /// <summary>
        /// 剧幕
        /// </summary>
        [JsonPropertyNameAttribute("scenes")]
        public List<Scene> Scenes { get => scenes; set => scenes = value; }
        /// <summary>
        /// 线索卡分组
        /// </summary>
        [JsonPropertyNameAttribute("clueCardGroups")]
        public List<ClueCardGroup> ClueCardGroups { get; set; }
        /// <summary>
        /// 线索卡
        /// </summary>
        [JsonPropertyNameAttribute("clueCards")]
        public List<ClueCard> ClueCards { get => clueCards; set => clueCards = value; }
        /// <summary>
        /// 剧本中玩家角色
        /// </summary>
        [JsonPropertyNameAttribute("roles")]
        public List<PlayerRole> Roles { get; set; }
        [JsonPropertyNameAttribute("cover")]
        public string Cover { get; set; }
        [JsonPropertyNameAttribute("httpBase")]
        public string HttpBase { get; set; }
        /// <summary>
        /// 存储所在的驱动器
        /// </summary>
        public DriveInfo DriveInfo { get => driveInfo; set => driveInfo = value; }
        public string CoverUrl()
        {
            return HttpBase + "/" + Cover;
        }
    }
}
